package com.lvmama.client.rhino;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.lvmama.common.result.Result;
import com.lvmama.pojo.base.Page;
import com.lvmama.pojo.dto.rhino.system.MenuDTO;
import com.lvmama.pojo.dto.rhino.system.MenuQueryDTO;
import com.lvmama.pojo.entity.rhino.system.Menu;
import com.lvmama.pojo.entity.rhino.system.User;

@FeignClient("rhino-web-service")
@RequestMapping("${server.servlet.context-path}")
public interface MenuClient {

    @RequestMapping(method = RequestMethod.POST, value = "/menu/getAllMenuListByUser", consumes = "application/json")
    Result<List<Menu>> getAllMenuListByUser(@RequestBody User user);

    @RequestMapping(method = RequestMethod.POST, value = "/menu/getMenuList", consumes = "application/json")
    Result<Page<Menu>> getMenuList(@RequestBody MenuQueryDTO query);

    @RequestMapping(method = RequestMethod.GET, value = "/menu/getMenuById")
    Result<Menu> getMenuById(@RequestParam("id") String id);

    @RequestMapping(method = RequestMethod.GET, value = "/menu/delete")
    Result<Boolean> deleteMenuById(@RequestParam("id") String id);

    @RequestMapping(method = RequestMethod.GET, value = "/menu/icons")
    Result<List<String>> getMenuIcons();

    @RequestMapping(method = RequestMethod.POST, value = "/menu/update", consumes = "application/json")
    Result<Boolean> updateMenu(@RequestBody MenuDTO menuDTO);

    @RequestMapping(method = RequestMethod.POST, value = "/menu/save", consumes = "application/json")
    Result<Boolean> saveMenu(@RequestBody MenuDTO menuDTO);
}
